#include "pdfglobalsignalmanager.h"
#include <QMutexLocker>

// 静态成员初始化
PDFGlobalSignalManager* PDFGlobalSignalManager::s_instance = nullptr;
QMutex PDFGlobalSignalManager::s_mutex;


PDFGlobalSignalManager::PDFGlobalSignalManager(QObject *parent)
    : QObject(parent)
{

}

PDFGlobalSignalManager::~PDFGlobalSignalManager()
{

}

PDFGlobalSignalManager *PDFGlobalSignalManager::instance()
{
    if (s_instance == nullptr)
    {
        QMutexLocker locker(&s_mutex);
        if (s_instance == nullptr)
        {
            s_instance = new PDFGlobalSignalManager();
        }
    }
    return s_instance;
}

void PDFGlobalSignalManager::destroy()
{
    QMutexLocker locker(&s_mutex);
    if (s_instance != nullptr)
    {
        delete s_instance;
        s_instance = nullptr;
    }
}
